package com.cloudbroker.openapi.manage.controller;

import static com.cloudbroker.bcs.platform.dav.common.util.RequestUtil.getSingleParameterMapForBody;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.cloudbroker.bcs.common.entity.HSBCPSBackVO;
import com.cloudbroker.bcs.common.util.VOUtil;
import com.cloudbroker.bcs.platform.dav.bizapi.service.business.plugs.result.ExtendAppGroupDavListResult;
import com.cloudbroker.bcs.platform.dav.bizapi.service.business.plugs.vo.ExtendAppGroupDelForm;
import com.cloudbroker.bcs.platform.dav.bizapi.service.business.plugs.vo.ExtendAppGroupUpdateForm;
import com.cloudbroker.bcs.platform.dav.bizapi.service.business.plugs.vo.ExtendGroupListForm;
import com.cloudbroker.bcs.platform.dav.bizapi.t2service.business.ExtendAppGroupT2BizService;
import com.cloudbroker.bcs.platform.dav.common.ext.annotation.SaveLog;

@Controller
public class ExtendAppGroupController {
	
	@Resource
	private ExtendAppGroupT2BizService extendAppGroupT2;

    @ResponseBody
    @RequestMapping("/func_extendapp_by_group")
    @SaveLog(remark = "dav通过分组ID获取组件列表")
	public ExtendAppGroupDavListResult funcExtendAppByGroup(HttpServletRequest request,String jsonpcallback) {
    	ExtendGroupListForm form = getSingleParameterMapForBody(request, ExtendGroupListForm.class);
    	return VOUtil.setJsonpResult(extendAppGroupT2.funcExtendAppByGroup(form), jsonpcallback);
	}
    
    @ResponseBody
    @RequestMapping("/func_extendapp_group_update")
    @SaveLog(remark = "修改分组中应用信息")
    public HSBCPSBackVO funcExtendAppGroupUpdate(HttpServletRequest request,String jsonpcallback) {
        ExtendAppGroupUpdateForm form = getSingleParameterMapForBody(request, ExtendAppGroupUpdateForm.class);
        return VOUtil.setJsonpResult(extendAppGroupT2.funcExtendAppGroupUpdate(form), jsonpcallback);
    }
    
    @ResponseBody
    @RequestMapping("/func_extendapp_group_del")
    @SaveLog(remark = "删除分组中应用信息")
    public HSBCPSBackVO funcExtendAppGroupDel(HttpServletRequest request,String jsonpcallback) {
        ExtendAppGroupDelForm form = getSingleParameterMapForBody(request, ExtendAppGroupDelForm.class);
        return VOUtil.setJsonpResult(extendAppGroupT2.funcExtendAppGroupDel(form), jsonpcallback);
    }
}
